import { getAdminApi } from '@/common/api'
import { getTimer } from '@/common/common';
import { Table } from 'antd'
import { render } from 'nprogress';
import React, { useEffect, useState } from 'react'
const columns = [
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '账号',
    dataIndex: 'username',
    key: 'username',
  },
  {
    title: '注册日期',
    dataIndex: 'time',
    key: 'time',
    render: (text) => {
      return getTimer(text)
    }
  },
  {
    title: '级别',
    dataIndex: 'role',
    key: 'role',
    render: (text) => {
      return text === "0" ? '管理员' : '超级管理员'
    }
  },
];
export default function TableComponent({adminDataSource}) {
  
  return (
    <div>
        <Table rowKey="_id" pagination={false}  columns={columns} dataSource={adminDataSource} />
    </div>
  )
}
